/*********** NOTES HEADER *********** 

DESCRIPTION: The analysis files saved the coefficient estimates on
the analysis dataset. This program pulls off the coefficient estimates

Datasets used:
 (1) death_fe, diab_fe, Overall_death_lim, Overall_diab_lim, Overall_hyp_lim, 
 (2) Overall_death_zip, Overall_diab_zip, Overall_hyp_zip, MbM_death_zip, MbM_diab_zip, MbM_hyp_zip, LL_death_zip, LL_diab_zip, LL_hyp_zip

Datasets created:
 (1) death_fe_small, diab_fe_small, Death_lim_small, Diab_lim_small, Hyp_lim_small
 (2)  Overall_death_zip_small, Overall_diab_zip_small, Overall_hyp_zip_small, MbM_death_small, MbM_diab_small, MbM_hyp_small, LL_death_small, LL_diab_small, LL_hyp_small
************************************/ 

set more off
capture log close
clear all

global origData "N:\MedicareClaims-P045601-BE"
global dataIn "N:\MedicareClaims-P045601-BE\Work\hosp_retro\health_out\Data-In\"
global dataOut "N:\MedicareClaims-P045601-BE\Work\hosp_retro\health_out\Data-Out\"
global dpath "N:\MedicareClaims-P045601-BE\Work\ay_data"
global dataProp "N:\MedicareClaims-P045601-BE\Work\hosp_retro\health_out\Data-Out\PropScore\Patients"
global logs "N:\MedicareClaims-P045601-BE\Work\hosp_retro\health_out\Logs\PropScore\Patients"
global dpath "N:\MedicareClaims-P045601-BE\Work\ay_data"
global skapath "N:\MedicareClaims-P045601-BE\Work\ska"

adopath +  "N:/SIL-Common/estout"
adopath +  "N:/SIL-Common/outreg2"
adopath +  "N:/SIL-Common/reghdfe-master/package"

use death_fe
 keep rn* *deat* *sesq* beta* 
  drop if _n>5000
 save death_fe_small.dta, replace
clear
use diab_fe 
 keep rn* *diab* *sesq* beta* 
  drop if _n>5000
 save diab_fe_small.dta , replace
clear
use hyp_fe
 keep rn* *hyp* *sesq* beta* 
  drop if _n>5000
 save hyp_fe_small.dta ,replace 
clear
use Overall_death_lim
 keep rn* *deat* *sesq* mef* mem* beta* 
  drop if _n>5000
 save Death_lim_small.dta , replace
clear
use Overall_diab_lim
 keep rn* *diab* *sesq* mef* mem* beta* 
  drop if _n>5000
 save Diab_lim_small.dta  , replace
clear
use Overall_hyp_lim
 keep rn* *hyp* *sesq* mef* mem* beta* 
  drop if _n>5000
 save Hyp_lim.dta , replace
clear
use Overall_death_zip
 keep rn* *deat* *sesq* mef* mem* beta* 
  drop if _n>5000
 save Overall_death_zip_small.dta , replace
clear
use Overall_diab_zip
 keep rn* *diab* *sesq* mef* mem* beta* 
  drop if _n>5000
 save Overall_diab_zip_small.dta , replace
clear
use Overall_hyp_zip
 keep rn* *hyp* *sesq* mef* mem* beta* 
  drop if _n>5000
 save Overall_hyp_zip_small.dta , replace

 
use MbM_death_zip
 keep rn* *deat* *sesq* mem* beta* 
  drop if _n>5000
  save mbm_death_small , replace 
clear
use MbM_diab_zip
 keep rn* *diab* *sesq* mem*  beta* 
  drop if _n>5000
  save mbm_diab_small , replace
clear
use MbM_hyp_zip
 keep rn* *hyp* *sesq* mem* beta* 
  drop if _n>5000
  save mbm_hyp_small , replace
  
use LL_death_zip
 keep rn* *deat* *sesq* mef* mem* beta* 
  drop if _n>5000
save ll_death_small , replace
clear
use ./LL_diab_zip
 keep rn* *diab* *sesq* mef* mem* beta* 
  drop if _n>5000
save ll_diab_small , replace
clear
use LL_hyp_zip
 keep rn* *hyp* *sesq* mef* mem* beta* 
  drop if _n>5000
  save ll_hyp_small , replace
clear
  
 
 
 
 